package com.lei.statistics.controller;


import com.lei.statistics.client.UcenterClient;
import com.lei.statistics.service.StatisticsDailyService;
import com.lei.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author 熊磊
 * @since 2020-06-18
 */
@RestController
@RequestMapping("/edu/statistics")
public class StatisticsDailyController {
    @Autowired
    private StatisticsDailyService staSevice;

    //统计某一天注册人数
    @PostMapping("/registerCount/{day}")
    public Result registerCount(@PathVariable("day") String day){
        staSevice.registerCount(day);
        return Result.ok();
    }
    //获取数据
    @GetMapping("/getData/{type}/{begin}/{end}")
    public Result getData(@PathVariable("type") String type,@PathVariable("end") String end,
                          @PathVariable("begin") String begin){
        Map<String,Object> map=staSevice.getData(type,begin,end);
        return Result.ok().data(map);
    }

}

